package com.company.cuobuliao.view;

import android.content.Context;
import android.graphics.Typeface;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;

import com.company.cuobuliao.application.MyApplication;

/**
 * 重写textview设置默认字体
 * Created by Oreo on 2017/7/5.
 */

public class ThinFontTextView extends AppCompatTextView {

    private Context mContext = null;
    Typeface texttypeface = null;

    public ThinFontTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        if (mContext == null) {
            this.mContext = context;
        }
        if (texttypeface == null) {
            texttypeface = MyApplication.texttypeface;
        }
        this.setTypeface(texttypeface);
    }


    public ThinFontTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        if (mContext == null) {
            this.mContext = context;
        }
        if (texttypeface == null) {
            texttypeface = MyApplication.texttypeface;
        }
        this.setTypeface(texttypeface);
    }


    public ThinFontTextView(Context context) {
        super(context);
        if (mContext == null) {
            this.mContext = context;
        }
        if (texttypeface == null) {
            texttypeface = MyApplication.texttypeface;
        }
        this.setTypeface(texttypeface);
    }
}
